﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bzure.Common.Core;
using System.ComponentModel.Composition;
using Bzure.Security;
using Bzure.Mvc.Views;

namespace Bzure.Mvc
{
    [Export(typeof(IContractFounder)), ExportMetadata("ProviderName", "ResourceAccessFounder")]
    public class ContractFounder : ContractFounderBase
    {
        [ImportMany]
        public IEnumerable<Lazy<IViewPlugin, IContractMetadata>> _viewPluginHandlerFounders;
        [ImportMany]
        public IEnumerable<Lazy<IContractFactory<ResourceAccess.IResourceAccess>, IContractMetadata>> _resourceAccessHandlerFounders;
        public override void PluginContract(Dictionary<Type, object> MEFPool)
        {
        }
        public override void PluginManyContract(Dictionary<Type, Dictionary<string, object>> MEFManyPool)
        {
            this.PluginLazyContract<IContractFactory<ResourceAccess.IResourceAccess>>(this._resourceAccessHandlerFounders, MEFManyPool);
            this.PluginLazyContract<IViewPlugin>(this._viewPluginHandlerFounders, MEFManyPool);
        }
    }
}
